-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add block gap support for group blocks #37459
Conversation
This is brilliant and was going to add this PR myself. Definitely would love to see this in 5.9. Now what about margin support for groups? 😂 (I know, I know...) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this one in @youknowriad! This is testing nicely for me, too, for both the Group and Row blocks. I did notice while sliding the Block spacing control that the inserter icon flickers, which doesn't happen when dragging the padding control. Not a blocker for this PR, but it'd be good for us to look into that separately.
Kapture.2021-12-17.at.10.31.06.mp4
I'm impressed at how powerful having a block spacing control is for adjusting the space between blocks. Because we can select multiple blocks and easily group them via the contextual menu in the block toolbar, this means that it's possible to use group blocks and spacing as a workaround for the absence of a margin control. @ndiego I'm just curious if that helps with the concerns you've raised surrounding block margins? (e.g. group two adjacent paragraph blocks and adjust block spacing to effectively replicate an individual block's margin controls).
@andrewserong this definitely goes a long way towards that and I 100% endorse this PR. If I group two paragraphs and set the block spacing to 0 on the group, the margin on the paragraphs will go to 0. Perfect! However, there will still be |
My thumbs up on this one too, it's important to have this |
This is a small feature but I'm adding the backport label as the 2022 theme is relying implicitly on this and if we land #37360 it will break the implicit usage in 2022 without the current PR. |
While working on a block theme, I noticed that I needed to tweak the block gap for specific sections or "rows" in different places. This would have been possible simply using the block gap support.
This PR enables the block gap support for a group block. It works properly but at the moment it also highlights a conceptual bug in block gap which is being worked on in #37360: Basically when you apply a gap to a column or to a parent container, that same gap is being applied to all its children (including nested containers).
Testing instructions